package com.zhangsun.springShiro.system.controller;

import com.zhangsun.springShiro.base.bean.ResponseData;
import com.zhangsun.springShiro.system.bean.UserResult;
import com.zhangsun.springShiro.system.service.UserService;
import com.zhangsun.springShiro.common.utils.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {

    @Autowired
    private UserService userService;

    @RequestMapping(value = "/user/login")
    @ResponseBody
    public ResponseData login(String userNo, String password) {
        UserResult userResult = userService.login(userNo, password);
        return ResponseUtil.success(userResult);
    }

}
